package com.handu.luna.core.domain.promotion;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.handu.luna.core.domain.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface ActivitiesRepository extends JpaRepository<Activities,Long>,BaseRepository<Activities>,JpaSpecificationExecutor<Activities> {

    /************************************商品详情页---开始*************************************************/

    //查询当前正在进行的优惠活动
    @Query("select a from Activities a where a.beginTime <= ?1 and a.endTime >= ?1")
    public List<Activities> findCurrent(Date date);



    /************************************商品详情页---结束*************************************************/

}
